package excercise;

import java.util.Scanner;

public class EX05_Q35 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		JandonVO sdf = new JandonVO();
		Scanner sd = new Scanner(System.in);
		System.out.println("돈을 내시오");
		sdf.setInG(sd.nextInt());
		System.out.println("물품 가격을 적으시오");
		sdf.setGold(sd.nextInt());
	    JandonService.show(sdf);
		
	}
}


class JandonVO{
	private int inG = 0;
	private int gold = 0;
	private int jand = 0;
	
	
	public JandonVO() {	}
	
	
	public void setInG(int inG){this.inG = inG;}
	public void setGold(int gold){this.gold = gold;}
	public void setJand(int jand){this.jand = jand;}
	
	
	public int getIng(){return this.inG;}
	public int getGold(){return this.gold;}
	public int getJand(){return this.jand; }
	
}


class JandonService{
	
	static void show(JandonVO sdf ){
		int ba[] = {50000,10000,5000,1000,500,100,50,10};
		sdf.setJand(sdf.getIng()-sdf.getGold());
	for(int i = 0; i<=7; i++){
		System.out.println(ba[i]+ "원권 : "+sdf.getJand()/ba[i]);
		sdf.setJand(sdf.getJand()%ba[i]);
	   }
	}
}